class User:
    def __init__(self,name,age):
        self.name = name
        self.age = age

    def __add__(self, other):
        return self.age + other.age

user1 = User('张三', 20)
user2 = User('李四', 26)
print(user1 + user2)  # 46 =>相当于user1.__add__(user2)
print(user1.__add__(user2))  # 46